package com.project.isaacwiki.controller;

import com.project.isaacwiki.service.ServiceQueryItem;
import com.project.isaacwiki.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class ControllerQueryItem {

    @Autowired
    private ServiceQueryItem serviceQueryItem;

    @RequestMapping("/QueryAllItemMvp")
    public Result queryItem()
    {
        return serviceQueryItem.queryAllItemMvp();
    }

    @RequestMapping("/QueryItemById")
    public Result queryItemById(int id)
    {
        return serviceQueryItem.queryItemById(id);
    }

    @RequestMapping("/QueryItemMvpByName")
    public Result queryItemMvpByName(String name){
        return serviceQueryItem.queryItemMvpByName(name);
    }
}
